<%@ page import="com.erpanderp.pr.model.entity.PurchaseRequestItem" %>



<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'itemNumber', 'error')} required">
	<label for="itemNumber">
		<g:message code="purchaseRequestItem.itemNumber.label" default="Item Number" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="itemNumber" type="number" value="${purchaseRequestItemInstance.itemNumber}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'accountAssignmentCategory', 'error')} ">
	<label for="accountAssignmentCategory">
		<g:message code="purchaseRequestItem.accountAssignmentCategory.label" default="Account Assignment Category" />
		
	</label>
	<g:textField name="accountAssignmentCategory" maxlength="1" value="${purchaseRequestItemInstance?.accountAssignmentCategory}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'itemCategory', 'error')} ">
	<label for="itemCategory">
		<g:message code="purchaseRequestItem.itemCategory.label" default="Item Category" />
		
	</label>
	<g:textField name="itemCategory" maxlength="1" value="${purchaseRequestItemInstance?.itemCategory}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'material', 'error')} ">
	<label for="material">
		<g:message code="purchaseRequestItem.material.label" default="Material" />
		
	</label>
	<g:textField name="material" maxlength="18" value="${purchaseRequestItemInstance?.material}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'shortText', 'error')} ">
	<label for="shortText">
		<g:message code="purchaseRequestItem.shortText.label" default="Short Text" />
		
	</label>
	<g:textField name="shortText" maxlength="40" value="${purchaseRequestItemInstance?.shortText}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'quantity', 'error')} required">
	<label for="quantity">
		<g:message code="purchaseRequestItem.quantity.label" default="Quantity" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="quantity" value="${fieldValue(bean: purchaseRequestItemInstance, field: 'quantity')}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'unit', 'error')} ">
	<label for="unit">
		<g:message code="purchaseRequestItem.unit.label" default="Unit" />
		
	</label>
	<g:textField name="unit" maxlength="3" value="${purchaseRequestItemInstance?.unit}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'materialGroup', 'error')} ">
	<label for="materialGroup">
		<g:message code="purchaseRequestItem.materialGroup.label" default="Material Group" />
		
	</label>
	<g:textField name="materialGroup" maxlength="3" value="${purchaseRequestItemInstance?.materialGroup}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'plant', 'error')} ">
	<label for="plant">
		<g:message code="purchaseRequestItem.plant.label" default="Plant" />
		
	</label>
	<g:textField name="plant" maxlength="4" value="${purchaseRequestItemInstance?.plant}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'storageLocation', 'error')} ">
	<label for="storageLocation">
		<g:message code="purchaseRequestItem.storageLocation.label" default="Storage Location" />
		
	</label>
	<g:textField name="storageLocation" maxlength="4" value="${purchaseRequestItemInstance?.storageLocation}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'purchasingGroup', 'error')} ">
	<label for="purchasingGroup">
		<g:message code="purchaseRequestItem.purchasingGroup.label" default="Purchasing Group" />
		
	</label>
	<g:textField name="purchasingGroup" maxlength="3" value="${purchaseRequestItemInstance?.purchasingGroup}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'desiredVendor', 'error')} ">
	<label for="desiredVendor">
		<g:message code="purchaseRequestItem.desiredVendor.label" default="Desired Vendor" />
		
	</label>
	<g:textField name="desiredVendor" maxlength="10" value="${purchaseRequestItemInstance?.desiredVendor}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'createdBy', 'error')} ">
	<label for="createdBy">
		<g:message code="purchaseRequestItem.createdBy.label" default="Created By" />
		
	</label>
	<g:textArea name="createdBy" cols="40" rows="5" maxlength="255" value="${purchaseRequestItemInstance?.createdBy}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'lastUpdatedBy', 'error')} ">
	<label for="lastUpdatedBy">
		<g:message code="purchaseRequestItem.lastUpdatedBy.label" default="Last Updated By" />
		
	</label>
	<g:textArea name="lastUpdatedBy" cols="40" rows="5" maxlength="255" value="${purchaseRequestItemInstance?.lastUpdatedBy}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'accountAssignments', 'error')} ">
	<label for="accountAssignments">
		<g:message code="purchaseRequestItem.accountAssignments.label" default="Account Assignments" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${purchaseRequestItemInstance?.accountAssignments?}" var="a">
    <li><g:link controller="accountAssignment" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="accountAssignment" action="create" params="['purchaseRequestItem.id': purchaseRequestItemInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'accountAssignment.label', default: 'AccountAssignment')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'deliveryDate', 'error')} required">
	<label for="deliveryDate">
		<g:message code="purchaseRequestItem.deliveryDate.label" default="Delivery Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="deliveryDate" precision="day"  value="${purchaseRequestItemInstance?.deliveryDate}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: purchaseRequestItemInstance, field: 'purchaseRequest', 'error')} required">
	<label for="purchaseRequest">
		<g:message code="purchaseRequestItem.purchaseRequest.label" default="Purchase Request" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="purchaseRequest" name="purchaseRequest.id" from="${com.erpanderp.pr.model.entity.PurchaseRequest.list()}" optionKey="id" required="" value="${purchaseRequestItemInstance?.purchaseRequest?.id}" class="many-to-one"/>
</div>

